package bb.lanxing.model.json;

import android.os.Parcel;
import android.os.Parcelable;
import com.alibaba.fastjson.annotation.JSONField;
import com.google.gson.annotations.SerializedName;
import bb.lanxing.util.JsonUtil;
import java.io.Serializable;
import org.json.JSONObject;

public class UserAvatarMedal implements Parcelable, Serializable {
    public static final Parcelable.Creator<UserAvatarMedal> CREATOR = new Parcelable.Creator<>() {

        public UserAvatarMedal[] newArray(int i) {
            return new UserAvatarMedal[i];
        }


        public UserAvatarMedal createFromParcel(Parcel parcel) {
            return new UserAvatarMedal(parcel);
        }
    };
    @SerializedName("mid")
    @JSONField(name = "mid")
    private long medalId;
    @SerializedName("mlevel")
    @JSONField(name = "mlevel")
    private int medalLevel;
    @SerializedName("url")
    @JSONField(name = "url")
    private String medalUrl;

    @Override
    public int describeContents() {
        return 0;
    }

    public UserAvatarMedal() {
    }

    public UserAvatarMedal(JSONObject jSONObject) {
        setUrl(JsonUtil.getStringValue("url", jSONObject));
        setMedalId(JsonUtil.getLongValue("mid", jSONObject));
        setMedalLevel(JsonUtil.getIntegerValue("mlevel", jSONObject));
    }

    public String getUrl() {
        return this.medalUrl;
    }

    public long getMedalId() {
        return this.medalId;
    }

    public int getMedalLevel() {
        return this.medalLevel;
    }

    public void setUrl(String str) {
        this.medalUrl = str;
    }

    public void setMedalId(long j) {
        this.medalId = j;
    }

    public void setMedalLevel(int i) {
        this.medalLevel = i;
    }

    @Override
    public void writeToParcel(Parcel parcel, int i) {
        parcel.writeString(this.medalUrl);
        parcel.writeLong(this.medalId);
        parcel.writeInt(this.medalLevel);
    }

    public UserAvatarMedal(Parcel parcel) {
        this.medalUrl = parcel.readString();
        this.medalId = parcel.readLong();
        this.medalLevel = parcel.readInt();
    }
}
